var OptionsStore = (function() {
	function OptionsStore() {    
	}	
	OptionsStore.prototype.save = function(options) {
		localStorage["options"] = JSON.stringify(options);
	};
	OptionsStore.prototype.load = function() {
		return this.loadJS(localStorage["options"]);
	};
  	OptionsStore.prototype.loadJS = function(data) {
		try {
			return JSON.parse(data);
		} catch (e) {
			console.log(e);
		}
		
		return {
			version: 1,
			replaceOnQuestionBox: true,
			replaceOnAnswers: true,
			randomizeOncePerQuestion: true,
			replaceOnAnswersMax: 4,
			fonts : [
				{				
					name: "Browser Standard",
					family: null,
					chance: 2,
					homepage: null,
					kanjiOnly: false
				},				
				{				
					name: "Sister Font",
					family:"SistersFS",
					chance: 4,
					homepage: "http://www.vector.co.jp/soft/winnt/writing/se496865.html",
					kanjiOnly: false
				},
				{
					name: "idfont Maru",
					family:"idfontMaru",
					chance: 4,
					homepage: "http://idfont.jp/",
					kanjiOnly: false
				},
				{	
					name: "Checkpoint Font",				
					family:"CheckPointFont",					
					chance: 3,
					homepage: "http://marusexijaxs.web.fc2.com/quizfont.html#quizfont2",
					kanjiOnly: false
				},				
				{
					name: "Aoyagi Reisho (Hard)",
					family:"aoyagireisyosimo",
					chance: 2,
					homepage: "http://opentype.jp/aoyagireisho.htm",
					kanjiOnly: true
				},
				{
					name: "Hakidame (Very Hard)",
					family:"hakidame",					
					chance: 1,
					homepage: "http://www.ankokukoubou.com/font/hakidame.htm",
					kanjiOnly: true
				}
			]
		};
	};
  
  return OptionsStore;
})();
